<template>
  <div>
    <el-berad></el-berad>
    <el-button type="primary" size="medium" @click="add">添加</el-button>
    <v-list @edit="edit"></v-list>
    <v-dialog
      ref="seckInfo"
      @cancel="cancel"
      :dialogInfo="dialogInfo"
    ></v-dialog>
  </div>
</template>

<script>
import vList from "./list";
import vDialog from "./dialog";
export default {
  data() {
    return {
      dialogInfo: {
        isShow: false,
        isAdd: true,
      },
    };
  },
  components: {
    vList,
    vDialog,
  },
  methods: {
    add() {
      this.dialogInfo.isShow = true;
      this.dialogInfo.isAdd = true;
    },
    cancel(e) {
      this.dialogInfo.isShow = e;
    },
    edit(e) {
      this.dialogInfo.isShow = true;
      this.dialogInfo.isAdd = false;
      this.$refs.seckInfo.lookup(e);
    },
  },
};
</script>

<style lang="" scoped>
  .el-button{
    margin: 20px 0;
  }
</style>
